//
//  BaseTabbarController.m
//  goldmetal
//
//  Created by mac on 2017/1/18.
//  Copyright © 2017年 宏鹿. All rights reserved.
//

#import "BaseTabbarController.h"
#import "BaseNavigationController.h"

@interface BaseTabbarController ()

@end

@implementation BaseTabbarController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    [self addChildViewControllers];

}

- (void)addChildViewControllers {
    [self setupChildViewControllerWithVcString:@"HomeVC" imageName:nil title:@"首页"];
    [self setupChildViewControllerWithVcString:@"MarketVC" imageName:nil title:@"行情"];
    [self setupChildViewControllerWithVcString:@"TradeVC" imageName:nil title:@"交易"];
    [self setupChildViewControllerWithVcString:@"DiscoverVC" imageName:nil title:@"发现"];
    [self setupChildViewControllerWithVcString:@"MeVC" imageName:nil title:@"我的"];
    
}

- (void)setupChildViewControllerWithVcString:(NSString *)vcString imageName:(NSString *)imageName title:(NSString *)title {
    Class cls = NSClassFromString(vcString);
    UIViewController *vc = [[cls alloc] init];
    vc.title = title;
    vc.tabBarItem.image = [UIImage imageNamed:imageName];
    BaseNavigationController *nav = [[BaseNavigationController alloc] initWithRootViewController:vc];
    [self addChildViewController:nav];
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/


@end
